<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of addquestion
 *
 * @author Miss
 */
include_once("adb.php");
class subdistrict extends adb{
    function subdistrict(){
			adb::adb();
		}
		
		/**
		*query all applicant in the table and store the dataset in $this->result	
		*@return if successful true else false
		*/
		
		function get_all_subdistricts(){
			$query="Select * from subdistrict";
			return $this->query($query);
		}
			
		function add_subdistrict($name,$district_id)
                {
			$query ="Insert into subdistrict values ('$name', $districtid)";
			return $this->query($query);
		}
                
                function get_subdistrict_by_id($subdistrictid)
                {
                    $query = "Select * from subdistrict where subdistrict_id = $subdistrictid";
                   // print $query;
                    return $this->query($query);
                }
		
		/**
		*updates the record identified by id 
		*/
//		function update_applicant($applicant_id,$firstname,$lastname,$othernames,$address,$residence,$relationahip_to_child,$workplace,$consent_id){
//			//write the SQL query and call $this->query()
//			$query="update applicant set firstname='$firstname',lastname='$lastname',othernames='$othernames',
//			address='$address',residence='$residence',relationahip_to_child='$relationahip_to_child',workplace='$workplace',consent_id='$consent_id',
//			last_modified=now()	where applicant_id=$applicant_id";
//			return $this->query($query);
//		}
//		/**
//		*query to delete a applicant 	
//		*@return if successful true else false
//		*/
//		function delete_applicant($applicant_id){
//			$query="Delete from applicant where applicant_id=$applicant_id";
//			return $this->query($query);
//		}
//		
//		function get_applicant_byID($applicant_id){
//			$query="Select * from applicant where applicant_id=$applicant_id";
//			return $this->query($query);
//		}
		
   
                //put your code here
               
                
                
}

 // $obj = new category();
 
// if($obj->get_all_categories())
// {
//     echo"cannot find categories";
// }
// 
//  echo"fetching";
//     $row = $obj->fetch();
//     while ($row)
//     {
//         echo $row['name'];
//         $row = $obj->fetch();
//     }
  
// else
// {
//      
// }
// echo"fetching";
// 
 ?>